package cn.lanqiao.jdbc;

import cn.lanqiao.jh.Student;

//封装业务 CRUD
public class StudentDao extends BaseDao<Student>{

    public int insert(User user) {
        return executeUpdate("insert into sys_user (user_name,password) values (?,?)",user.getUserName(),user.getPassword());
    }

    public int delete(int id) {
        return executeUpdate("delete form sys_user where id = ?" , id);
    }

    public int update(User user) {
        return executeUpdate("");
    }



    public static void main(String[] args) {
        new StudentDao().executeUpdate("insert into sys_user (user_name,password) values (?,?)", 111, 222);
//        new StudentDao().executeUpdate("delete from sys_user where id = 13");
//        Student student = new Student();
//        student.setStu_name("david");
//        student.setStu_age(20);
//        StudentDao studentDao = new StudentDao();
//        studentDao.insert(student);
//        List<Student> studentList = studentDao.query("david");
//        for (Student stu : studentList){
//            System.out.println(stu);
//        }
    }
}
